<style type="text/css">
	.order_box {
		margin-bottom: 15px;
	}

   	.order_title {
   		padding : 0px 15px;
   		font-size: 14px;
   	}
   	
   	.order_info {
   		padding: 0px;
   	}
   	.order_tip {
   		font-size: 12px;
   	}
   	
   	.order_opts {
   		padding : 2px 15px;
   		font-size: 14px;
   		background-color: #fff;
   		border-left: 0px;
   		border-right: 0px;
   		border-top: 1px dashed #ddd;
   	}
   	.order_opts .button {
   		line-height: 15px;
   		padding: 0px;
   	}
   	.order_opts .button:after {
   		content: none;
   	}
</style>
<ion-view title="我的订单">
	<ion-nav-buttons side="left">
    	<button class="button button-clear icon ion-ios-arrow-back" ng-click="backGo()"></button>
    </ion-nav-buttons>
    <ion-tabs class="tabs-top tabs-striped has-header">
        <ion-tab title="待支付" on-select="clickTab('1')">
        	<ion-view>  
           		<ion-content class="content has-header">
           			<ion-list ng-show="orderList.length > 0">
						<div ng-repeat="order in orderList" class="order_box">
							<div class="item item-divider row order_title">
								<span class="col col-50">订单号：{{order.orderId}}</span>
								<span class="col col-25 col-offset-25" ng-style="{'color' : order.orderStatus == '1' || order.orderStatus == '5' ? 'gray' : 'red'}">{{order.orderStatusName}}</span>
							</div>
							<div class="item order_info" href="javascript:void(0);" ng-click="toPay(order)">
								<div class="row">
									<div class="col col-80">
										{{order.lineName}}
									</div>
									<div class="col col-10 col-offset-10">
										<i class="icon ion-ios-arrow-right"></i>
									</div>
								</div>
								<div class="row">
            						<span class="col col-33 order_tip">
            							<i class="icon ion-clock"></i> {{order.departTime}}
            						</span>
									<span class="col col-33 order_tip"></span>
								</div>
							</div>
							<div class="item item-divider row order_opts">
								<div class="col col-25 col-center" style="color: red;">总计：{{order.discountedAmount | currency : '￥'}}</div>
								<button class="button button-light button-small  col col-20 col-offset-33" ng-click="cancelOrder(order)">
									取消订单
								</button> &nbsp;
								<button ng-show="order.orderStatus != '2'" class="button button-light button-small col col-20" style="color: red;" ng-click="payNow(order)">
									立即支付
								</button>
							</div>
						</div>
                	</ion-list>
					<div ng-show="orderList.length == 0">
						<h4 style="text-align: center">无数据</h4>
					</div>
           		</ion-content>
           </ion-view>  
        </ion-tab>
        <ion-tab title="已支付" on-select="clickTab('2')">
            <ion-view>
           		<ion-content class="content has-header">
           			<ion-list ng-show="orderList.length > 0">
	            		<div ng-repeat="order in orderList" class="order_box">
	            			<div class="item item-divider row order_title">
						    	<span class="col col-50">订单号：{{order.orderId}}</span>
						    	<span class="col col-25 col-offset-25" ng-style="{'color' : order.orderStatus == '3' ? 'green' : 'red'}">{{order.orderStatusName}}</span>
						  	</div>
						  	<div class="item order_info" href="javascript:;" ng-click="toHadPay(order)">
						  		<div class="row">
					  				<div class="col col-80">
										{{order.lineName}}
					  				</div>
           							<div class="col col-10 col-offset-10">
	            						<i class="icon ion-ios-arrow-right"></i>
	            					</div>
           						</div>
           						<div class="row">
            						<span class="col col-33 order_tip">
            							<i class="icon ion-clock"></i> {{order.departTime}}
            						</span>
            						<span class="col col-33 order_tip"></span>
           						</div>
            				</div>

							<div class="item item-divider row order_opts">
								<div class="col col-25 col-center" style="color: red;">总计：{{order.discountedAmount | currency : '￥'}}</div>
								<div class="col col-20 col-offset-33">

								</div> &nbsp;
								<button ng-show="order.orderStatus == '3'" class="button button-light button-small col col-20" ng-click="toRefund(order)">
									申请退款
								</button>
							</div>
	            		</div>
                	</ion-list>
					<div ng-show="orderList.length == 0">
						<h4 style="text-align: center">无数据</h4>
					</div>
           		</ion-content>
           </ion-view>
        </ion-tab>
		<ion-tab title="退款记录" on-select="clickTab('3')">
			<ion-view>
				<ion-content class="content has-header">
					<ion-list ng-show="orderList.length > 0">
						<div ng-repeat="order in orderList" class="order_box">
							<div class="item item-divider row order_title">
								<span class="col col-50">订单号：{{order.orderId}}</span>
								<span class="col col-25 col-offset-25" ng-style="{'color':order.orderBackStatus == '10' ? 'green' : (order.orderBackStatus == '11' || order.orderBackStatus == '20') ? 'red' : 'gray' }">{{order.orderBackStatusName}}</span>
							</div>
							<div class="item order_info" href="javascript:;" ng-click="refundDetail(order)">
								<div class="row">
									<div class="col col-80">
										{{order.lineName}}
									</div>
									<div class="col col-10 col-offset-10">
										<i class="icon ion-ios-arrow-right"></i>
									</div>
								</div>
								<div class="row">
            						<span class="col col-33 order_tip">
            							<i class="icon ion-clock"></i> {{order.departTime}}
            						</span>
									<span class="col col-33 order_tip"></span>
								</div>
							</div>

							<div class="item item-divider row order_opts">
								<div class="col col-25 col-center" style="color: red;" ng-show="order.refundMoney <= 0">退款金额：{{0 | currency : '￥'}}</div>
								<div class="col col-25 col-center" style="color: red;" ng-show="order.refundMoney > 0">退款金额：{{order.refundMoney | currency : '￥'}}</div>
								<div class="col col-20 col-offset-33">
								</div> &nbsp;
								<button ng-show="order.orderStatus == '3'" class="button button-light button-small col col-20" ng-click="toRefund(order)">
									申请退款
								</button>
							</div>
						</div>
					</ion-list>
					<div ng-show="orderList.length == 0">
						<h4 style="text-align: center">无数据</h4>
					</div>
				</ion-content>
			</ion-view>
		</ion-tab>
	</ion-tabs>
</ion-view>